<include file="public@header" />
<link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
</head>
<body>
<div class="wrap">
  <ul class="nav nav-tabs">
    <li><a href="{:url('admin/vipExplain/index')}">列表</a></li>
    <li class="active"><a>添加</a></li>
  </ul>
  <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('admin/vipExplain/add')}">
    <div class="form-group">
      <label for="langId" class="col-sm-2 control-label"><span class="form-required">*</span>语言</label>
      <div class="col-md-6 col-sm-10">
        <select class="form-control" name="lang_id" id="langId">
          <foreach name="countryData" item="lang">
            <option value="{$lang['id']}">{$lang['name']}</option>
          </foreach>
        </select>
      </div>
    </div>

    <div class="form-group">
      <label for="name" class="col-sm-2 control-label"><span class="form-required">*</span>权益名称</label>
      <div class="col-md-6 col-sm-10">
        <input type="text" name="name" id="name" class="form-control" />
      </div>
    </div>

    <div class="form-group">
      <label for="name_cn" class="col-sm-2 control-label"><span class="form-required">*</span>权益中文名称</label>
      <div class="col-md-6 col-sm-10">
        <input type="text" name="name_cn" id="name_cn" class="form-control" />
      </div>
    </div>

    <div class="form-group">
      <label for="sort" class="col-sm-2 control-label"><span class="form-required">*</span>排序</label>
      <div class="col-md-6 col-sm-10">
        <input type="text" name="sort" id="sort" class="form-control" />
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-2 control-label">图标</label>
      <div class="col-md-6 col-sm-10">
        <input type="hidden" name="icon_src" id="iconSrc" value="">
        <a href="javascript:uploadOneImage('图片上传','#iconSrc');">
          <img src="__TMPL__/public/assets/images/default-thumbnail.png"
               id="iconSrc-preview"
               style="cursor: pointer;max-width:100px;max-height:100px;"/>
        </a>
        <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片"> 建议尺寸： 300 X 300
      </div>
    </div>

    <div class="form-group">
      <label for="explain" class="col-sm-2 control-label"><span class="form-required">*</span>权益内容</label>
      <div class="col-md-6 col-sm-10">
          <textarea name="explain" id="explain" class="form-control" rows="10"></textarea>
      </div>
    </div>

    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
        <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
        <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
      </div>
    </div>
  </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/layui/layui.js"></script>
<script type="text/javascript">
  (function(){
    $('.btn-cancel-thumbnail').click(function () {
      $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
      $('#thumbnail').val('');
    });

    $('.btn-cancel-thumbnail2').click(function () {
      $('#thumbnail2-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
      $('#thumbnail2').val('');
    });
  })()

</script>
</body>
</html>